Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable HAVE_STRUCT_CMSGHDR when building with mingw #1464

Merged
merged 1 commit into from
Jul 12, 2024

Conversation

anyc
Copy link
Contributor

@anyc anyc commented Jul 11, 2024

When building libcoap with mingw, I noticed that coap_session_get_ifindex() always return zero. In the code, it looks like this is always set to zero if HAVE_STRUCT_CMSGHDR is unset in line:

packet->ifindex = 0;

Wouldn't -1 be a better value to indicate an undefined value?

If libcoap is built for Windows without mingw, HAVE_STRUCT_CMSGHDR is always defined. In this PR, I removed the special handling of mingw, added a few aliases and the code seems to work with HAVE_STRUCT_CMSGHDR defined and mingw.

Copy link
Collaborator

@mrdeep1 mrdeep1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of minor things.

src/coap_io.c Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
@anyc anyc force-pushed the develop branch 3 times, most recently from deb2768 to bfd7468 Compare July 11, 2024 18:38
Copy link
Collaborator

@mrdeep1 mrdeep1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor documentation fixes

src/coap_io.c Outdated Show resolved Hide resolved
src/coap_io.c Outdated Show resolved Hide resolved
@mrdeep1 mrdeep1 merged commit aac5de9 into obgm:develop Jul 12, 2024
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants